package test.db.mysql.table;

public enum SharerTable implements Table {
    SID(Column.sid),
    QUESTION_SID(Column.questionSid),
    USER_SID(Column.userSid),
    TARGET_SID(Column.targetSid),
    SHARE_TYPE(Column.shareType);
    
    private final Column column;
    private static final String TYPE_SID = "VARCHAR(20)";
    private static final String TYPE_QUESTION_SID = "VARCHAR(20)";
    private static final String TYPE_USER_SID = "VARCHAR(20)";
    private static final String TYPE_TARGET_SID = "VARCHAR(20)";
    private static final String TYPE_SHARE_TYPE = "VARCHAR(12)";

    SharerTable(Column column) {
        this.column = column;
    }
    
    private enum Column {
        sid {
            String getType() {
                return TYPE_SID;
            }
        },

        questionSid {
            String getType() {
                return TYPE_QUESTION_SID;
            }
        },
        
        userSid {
            String getType() {
                return TYPE_USER_SID;
            }
        },
        
        targetSid {
            String getType() {
                return TYPE_TARGET_SID;
            }
        },
        
        shareType {
            String getType() {
                return TYPE_SHARE_TYPE;
            }
        };
        
        abstract String getType();
    }
    
    public String getType() {
        return column.getType();
    }
    
    public void initData() throws Exception {
        System.out.println("CALL NOW");
    }
}